﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Threading.Tasks;
using DailyDiet.Models;

namespace DailyDiet.Services
{
    /// <summary>
    /// 缓存管理类
    /// </summary>
    public interface ICacheSerializeService {
        /// <summary>
        /// 序列化方法
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="cache"></param>
        /// <param name="CacheKey"></param>
        /// <returns></returns>
        Task SerializeAsync<T>(Cache<T> cache, string CacheKey);

        /// <summary>
        /// 反序列化方法
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="CacheKey"></param>
        /// <returns></returns>
        Task<Cache<T>> DeSerializeAsync<T>(String CacheKey);
    }
}
